package java1;

import java.util.*;

public class Number {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (in.hasNext()) {
		String n = in.next();
		char[] arr;
		int sum = 0;
		arr = n.toCharArray();
		for (int i = 0; i < n.length(); i++) {
			if (arr[i]!= '-' && arr[i]!= '.') {
				sum += arr[i]-48;
				}
			}
		System.out.println(sum);
		}
	}
	
}
